package leetcode.leetcode20xx.leetcode2081;

public class Solution {

    private static final long[][] ans = {
            {},
            {},
            {
                    0L, 1L, 4L, 9L, 16L, 25L, 58L, 157L, 470L, 1055L, 1772L, 9219L, 18228L, 33579L, 65802L, 105795L,
                    59030L, 212865L, 286602L, 872187L, 2630758L, 4565149L, 6544940L, 9674153L, 14745858L, 20005383L,
                    25846868L, 39347399L, 759196316L, 1669569335L, 2609044274L
            },
            {
                    0L, 1L, 3L, 7L, 15L, 136L, 287L, 499L, 741L, 1225L, 1881L, 2638L, 31730L, 80614L, 155261L, 230718L,
                    306985L, 399914L, 493653L, 1342501L, 2863752L, 5849644L, 9871848L, 14090972L, 18342496L, 22630320L,
                    28367695L, 36243482L, 44192979L, 71904751L, 155059889L
            },
            {
                    0L, 1L, 3L, 6L, 11L, 66L, 439L, 832L, 1498L, 2285L, 3224L, 11221L, 64456L, 119711L, 175366L,
                    233041L, 739646L, 2540727L, 4755849L, 8582132L, 12448815L, 17500320L, 22726545L, 27986070L,
                    33283995L, 38898160L, 44577925L, 98400760L, 721411086L, 1676067545L, 53393239260L
            },
            {
                    0L, 1L, 3L, 6L, 10L, 16L, 104L, 356L, 638L, 1264L, 1940L, 3161L, 18912L, 37793L, 10125794L,
                    20526195L, 48237967L, 78560270L, 126193944L, 192171900L, 1000828708L, 1832161846L, 2664029984L,
                    3500161622L, 4336343260L, 6849225412L, 9446112364L, 12339666346L, 19101218022L, 31215959143L,
                    43401017264L
            },
            {
                    0L, 1L, 3L, 6L, 10L, 15L, 22L, 77L, 188L, 329L, 520L, 863L, 1297L, 2074L, 2942L, 4383L, 12050L,
                    19827L, 41849L, 81742L, 156389L, 325250L, 1134058L, 2043967L, 3911648L, 7009551L, 11241875L,
                    15507499L, 19806423L, 24322577L, 28888231L
            },
            {
                    0L, 1L, 3L, 6L, 10L, 15L, 21L, 29L, 150L, 321L, 563L, 855L, 17416L, 83072L, 2220384L, 6822448L,
                    13420404L, 20379000L, 29849749L, 91104965L, 321578997L, 788407661L, 1273902245L, 1912731081L,
                    2570225837L, 3428700695L, 29128200347L, 69258903451L, 115121130305L, 176576075721L, 241030621167L
            },
            {
                    0L, 1L, 3L, 6L, 10L, 15L, 21L, 28L, 37L, 158L, 450L, 783L, 1156L, 1570L, 2155L, 5818L, 14596L,
                    27727L, 41058L, 67520L, 94182L, 124285L, 154588L, 362290L, 991116L, 1651182L, 3148123L, 5083514L,
                    7054305L, 11253219L, 66619574L
            },
            {
                    0L, 1L, 3L, 6L, 10L, 15L, 21L, 28L, 36L, 227L, 509L, 882L, 1346L, 1901L, 2547L, 3203L, 10089L,
                    35841L, 63313L, 105637L, 156242L, 782868L, 2323319L, 4036490L, 5757761L, 7586042L, 9463823L,
                    11349704L, 13750746L, 16185088L, 18627530L
            }
    };


    public long kMirror(int k, int n) {
        return ans[k][n];
    }
}
